<p>For <a href="#root/_help_CdNpE2pqjmI6">script code notes</a>, Trilium offers
  an API that gives them access to various features of the application.</p>
<p>There are two APIs:</p>
<ul>
  <li>One for the front-end scripts:&nbsp;<a class="reference-link" href="#root/_help_Q2z6av6JZVWm">Frontend API</a>
  </li>
  <li>One for the back-end scripts:&nbsp;<a class="reference-link" href="#root/_help_MEtfsqa5VwNi">Backend API</a>
  </li>
</ul>
<p>In both cases, the API resides in a global variable, <code>api</code>,
  that can be used anywhere in the script.</p>
<p>For example, to display a message to the user the following front-end
  script can be used:</p><pre><code class="language-text-x-trilium-auto">api.showMessage("Hello world.");</code></pre>
<aside
class="admonition note">
  <p><strong>Note</strong>
    <br>The Script API is currently experimental and may undergo changes in future
    updates.</p>
  </aside>